<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<style>

    .container{
        position: relative;
    }

    div{
        width: 200px;
        height: 200px;
    }
    .box1{
        background-color: red;
    }
    .box2{
        background-color: green;
        /* 绝对定位：拖标*/
        position: absolute;
        /* 绝对定位，如果没有设置参照元素，默认是以 html 进行定位*/
        /* 如果绝对定位的上级元素存在定位（固定、相对定位）以他们作为参照对象*/
        left: 0px;
        top: 0px;

    }
    .box3{
        background-color: blue;
    }


</style>

</body>
<div class="container">
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
</div>
</html>